package cn.weekimwee.firstlineofcodeforkotlin.unit3

import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import cn.weekimwee.firstlineofcodeforkotlin.R
import kotlinx.android.synthetic.main.title.view.*
import org.jetbrains.anko.toast


/**
 * Created by Wee Kim Wee on 2018/2/9.
 */
class TitleLayout(context: Context,attrs: AttributeSet?) :LinearLayout(context,attrs){
    init {
        LayoutInflater.from(context).inflate(R.layout.title,this,true)
        back.setOnClickListener { (context as Activity).finish() }
        edit.setOnClickListener { context.toast("edit tttttttt") }
    }
}